package com.flink.batch.core;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.operators.DataSource;
import org.apache.flink.configuration.Configuration;

import javax.xml.crypto.Data;

/**
 * @version v1.0
 * @ProjectName flinkwarehouse
 * @ClassName DiGuiReadFile
 * @Description TODO 递归读取文件夹里面的内容
 * @Author wudl
 * @Date 2020/8/28 15:27
 */

public class DiGuiReadFile {
    public static void main(String[] args) throws Exception {
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(10);
        Configuration config = new Configuration();
        //设置递归参数
        config.setBoolean("recursive.file.enumeration", true);

        DataSet<String> ds = env.readTextFile("file:///D:\\tmp").withParameters(config);
        ds.print();

    }
}
